(import
 (except (rnrs base) map)
 (only (guile)
       lambda* λ)
 (math)
 ;; SRFI 1 - list procs
 (srfi srfi-1)
 ;; SRFI 64 - unit testing forms
 (srfi srfi-64))


(test-begin "math-test")

(test-group
 "next-in-circle"

 (test-assert "next-in-circle-01"
   (equal? 9 (next-in-circle 8 10)))

 (test-assert "next-in-circle-02"
   (equal? 0 (next-in-circle 9 10)))

 (test-assert "next-in-circle-03"
   (equal? 1 (next-in-circle 0 10)))

 (test-assert "next-in-circle-04"
   (equal? 6 (next-in-circle 5 10))))

(test-group
 "previous-in-circle"

 (test-assert "previous-in-circle-01"
   (equal? 5 (previous-in-circle 0 6)))

 (test-assert "previous-in-circle-02"
   (equal? 0 (previous-in-circle 1 6)))

 (test-assert "previous-in-circle-03"
   (equal? 4 (previous-in-circle 5 6)))

 (test-assert "previous-in-circle-04"
   (equal? 2 (previous-in-circle 3 6))))

(test-end "math-test")
